<?php

namespace app\shop\exception;

use app\shop\library\response\ResponseCode;

class NotFoundException extends CustomException
{
    /**
     * 资源未找到异常
     * @param string   $errorMsg     错误提示
     * @param int|null $businessCode 错误业务码
     */
    public function __construct(
        string $errorMsg = ResponseCode::NOT_FOUND['msg'],
        int $businessCode = null,
    ) {
        $this->httpStatus   = ResponseCode::NOT_FOUND['code'];
        $this->businessCode = $businessCode ?? ResponseCode::NOT_FOUND['code'];
        $this->errorMsg     = $errorMsg;

        parent::__construct($this->errorMsg);
    }
}
